import axios from "axios";
import { tip } from "./alert";

const instance=axios.create({
    // baseURL:'http://127.0.0.1:4523/m1/2326953-0-default',
    baseURL:'http://localhost:9527',
    // baseURL:'https://www.aoaoy33.site/api/',
    headers:{
        "Content-Type":" application/json",
        // "X-LC-Id": "TRsB5LdkcFlIMkDtIKNvMrkJ-gzGzoHsz",
        // "X-LC-Key": "Ouk0qbrEJ49pJ6gw8xJ5euFi",
        // "X-LC-Session": "qmdj8pdidnmyzp0c7yqil91oc" 
    }
})

// 添加请求拦截器
instance.interceptors.request.use(function (config) {
    return config;
  }, function (error) {
    return Promise.reject(error);
  });

// 添加响应拦截器
instance.interceptors.response.use(function (response) {
    return response;
  }, function (error) {
    console.log(error);
    
    return Promise.reject(error);
  });


  export default instance